package edge.display.backend.MsgReceiver.Grpc;

import static io.grpc.MethodDescriptor.generateFullMethodName;
import static io.grpc.stub.ClientCalls.asyncUnaryCall;
import static io.grpc.stub.ClientCalls.blockingUnaryCall;
import static io.grpc.stub.ClientCalls.futureUnaryCall;
import static io.grpc.stub.ServerCalls.asyncUnaryCall;
import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall;

/**
 * <pre>
 * server
 * </pre>
 */
@javax.annotation.Generated(
        value = "by gRPC proto compiler (version 1.0.0)",
        comments = "Source: Datas.proto")
public class SendResultGrpc {

    public static final String SERVICE_NAME = "SendResult";
    // Static method descriptors that strictly reflect the proto.
    @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901")
    public static final io.grpc.MethodDescriptor<Datas.toServer,
            Datas.toClient> METHOD_SEND_REQUEST =
            io.grpc.MethodDescriptor.create(
                    io.grpc.MethodDescriptor.MethodType.UNARY,
                    generateFullMethodName(
                            "SendResult", "SendRequest"),
                    io.grpc.protobuf.ProtoUtils.marshaller(Datas.toServer.getDefaultInstance()),
                    io.grpc.protobuf.ProtoUtils.marshaller(Datas.toClient.getDefaultInstance()));
    private static final int METHODID_SEND_REQUEST = 0;

    private SendResultGrpc() {
    }

    /**
     * Creates a new async stub that supports all call types for the service
     */
    public static SendResultStub newStub(io.grpc.Channel channel) {
        return new SendResultStub(channel);
    }

    /**
     * Creates a new blocking-style stub that supports unary and streaming output calls on the service
     */
    public static SendResultBlockingStub newBlockingStub(
            io.grpc.Channel channel) {
        return new SendResultBlockingStub(channel);
    }

    /**
     * Creates a new ListenableFuture-style stub that supports unary and streaming output calls on the service
     */
    public static SendResultFutureStub newFutureStub(
            io.grpc.Channel channel) {
        return new SendResultFutureStub(channel);
    }

    public static io.grpc.ServiceDescriptor getServiceDescriptor() {
        return new io.grpc.ServiceDescriptor(SERVICE_NAME,
                METHOD_SEND_REQUEST);
    }

    /**
     * <pre>
     * server
     * </pre>
     */
    public static abstract class SendResultImplBase implements io.grpc.BindableService {

        /**
         *
         */
        public void sendRequest(Datas.toServer request,
                                io.grpc.stub.StreamObserver<Datas.toClient> responseObserver) {
            asyncUnimplementedUnaryCall(METHOD_SEND_REQUEST, responseObserver);
        }

        @Override
        public io.grpc.ServerServiceDefinition bindService() {
            return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
                    .addMethod(
                            METHOD_SEND_REQUEST,
                            asyncUnaryCall(
                                    new MethodHandlers<
                                            Datas.toServer,
                                            Datas.toClient>(
                                            this, METHODID_SEND_REQUEST)))
                    .build();
        }
    }

    /**
     * <pre>
     * server
     * </pre>
     */
    public static final class SendResultStub extends io.grpc.stub.AbstractStub<SendResultStub> {
        private SendResultStub(io.grpc.Channel channel) {
            super(channel);
        }

        private SendResultStub(io.grpc.Channel channel,
                               io.grpc.CallOptions callOptions) {
            super(channel, callOptions);
        }

        @Override
        protected SendResultStub build(io.grpc.Channel channel,
                                       io.grpc.CallOptions callOptions) {
            return new SendResultStub(channel, callOptions);
        }

        /**
         *
         */
        public void sendRequest(Datas.toServer request,
                                io.grpc.stub.StreamObserver<Datas.toClient> responseObserver) {
            asyncUnaryCall(
                    getChannel().newCall(METHOD_SEND_REQUEST, getCallOptions()), request, responseObserver);
        }
    }

    /**
     * <pre>
     * server
     * </pre>
     */
    public static final class SendResultBlockingStub extends io.grpc.stub.AbstractStub<SendResultBlockingStub> {
        private SendResultBlockingStub(io.grpc.Channel channel) {
            super(channel);
        }

        private SendResultBlockingStub(io.grpc.Channel channel,
                                       io.grpc.CallOptions callOptions) {
            super(channel, callOptions);
        }

        @Override
        protected SendResultBlockingStub build(io.grpc.Channel channel,
                                               io.grpc.CallOptions callOptions) {
            return new SendResultBlockingStub(channel, callOptions);
        }

        /**
         *
         */
        public Datas.toClient sendRequest(Datas.toServer request) {
            return blockingUnaryCall(
                    getChannel(), METHOD_SEND_REQUEST, getCallOptions(), request);
        }
    }

    /**
     * <pre>
     * server
     * </pre>
     */
    public static final class SendResultFutureStub extends io.grpc.stub.AbstractStub<SendResultFutureStub> {
        private SendResultFutureStub(io.grpc.Channel channel) {
            super(channel);
        }

        private SendResultFutureStub(io.grpc.Channel channel,
                                     io.grpc.CallOptions callOptions) {
            super(channel, callOptions);
        }

        @Override
        protected SendResultFutureStub build(io.grpc.Channel channel,
                                             io.grpc.CallOptions callOptions) {
            return new SendResultFutureStub(channel, callOptions);
        }

        /**
         *
         */
        public com.google.common.util.concurrent.ListenableFuture<Datas.toClient> sendRequest(
                Datas.toServer request) {
            return futureUnaryCall(
                    getChannel().newCall(METHOD_SEND_REQUEST, getCallOptions()), request);
        }
    }

    private static class MethodHandlers<Req, Resp> implements
            io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>,
            io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>,
            io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>,
            io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> {
        private final SendResultImplBase serviceImpl;
        private final int methodId;

        public MethodHandlers(SendResultImplBase serviceImpl, int methodId) {
            this.serviceImpl = serviceImpl;
            this.methodId = methodId;
        }

        @Override
        @SuppressWarnings("unchecked")
        public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver) {
            switch (methodId) {
                case METHODID_SEND_REQUEST:
                    serviceImpl.sendRequest((Datas.toServer) request,
                            (io.grpc.stub.StreamObserver<Datas.toClient>) responseObserver);
                    break;
                default:
                    throw new AssertionError();
            }
        }

        @Override
        @SuppressWarnings("unchecked")
        public io.grpc.stub.StreamObserver<Req> invoke(
                io.grpc.stub.StreamObserver<Resp> responseObserver) {
            switch (methodId) {
                default:
                    throw new AssertionError();
            }
        }
    }

}
